gnome = import('gnome')

adwaita_dep = dependency('libadwaita-1', method: 'pkg-config')

EventClient_resources = gnome.compile_resources(
  'EventResources',
  'resources/event.gresource.xml',
  source_dir: 'resources',
  c_name: 'EventResources',
)

server_src_path = '../../server/src'
test_src_path = '../test'

client_src = [
  'EventApplication.c',
  'EventWindow.c',
  'main.c',
  'EventEntry.c',
  'GroupEntry.c',
  'EventAddDialog.c',
  'EventNetwork.c',
  'ObjectArray.c',
  'EventLogonPage.c',
  'EventMainPage.c',
  'MemberManager.c'
]

server_src = [
  server_src_path / 'EventObject.c',
  server_src_path / 'ResponseType.c',
  server_src_path / 'EventString.c',
  server_src_path / 'EventList.c',
  server_src_path / 'EventNode.c',
  server_src_path / 'EventRaw.c',
  server_src_path / 'EventFileDriver.c',
]

test_src = [
  'ObjectArray.c',
  test_src_path / 'object-array-test.c',
]

src = [client_src, server_src]

EventClient_deps = [adwaita_dep, config_h]

exe = executable(
  'event_client',
  EventClient_resources,
  sources: src,
  dependencies: EventClient_deps,
  cpp_args: '-g',
  install: true,
)

exe_test = executable(
  'test_program',
  sources: [server_src, test_src],
)

test('测试 EventAndTask 客户端', exe)